package cn.ihelloworld.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import cn.ihelloworld.bean.Catagory;
import cn.ihelloworld.dao.ICatagoryDao;
import cn.ihelloworld.dao.Pagation;
import cn.ihelloworld.service.ICatagoryService;

@Service
@Transactional
public class CatagoryServiceImpl implements ICatagoryService {
	
	@Autowired
	private ICatagoryDao catagoryDao;
	@Override
	public Catagory get(String id) {
		// TODO Auto-generated method stub
		return catagoryDao.get(id);
	}

	@Override
	public List<Catagory> select(Catagory t) {
		// TODO Auto-generated method stub
		return catagoryDao.select(t);
	}

	@Override
	public Pagation<Catagory> selectForPage(Catagory t, int currentPage,
			int pageSize) {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public void saveOrUpdate(Catagory t) {
		// TODO Auto-generated method stub
		catagoryDao.saveOrUpdate(t);
	}

	@Override
	public void delete(String id) {
		// TODO Auto-generated method stub
		catagoryDao.delete(id);
	}

	@Override
	public void delete(String[] ids) {
		// TODO Auto-generated method stub
		catagoryDao.delete(ids);
	}

	@Override
	public void saveOrUpdate(List<Catagory> catagorys) {
		// TODO Auto-generated method stub
		for(Catagory catagory:catagorys){
			catagoryDao.saveOrUpdate(catagory);
		}
		
	}

}
